import request from '@/utils/request'

// 查询结算单明细列表
export function listStatementitem(query) {
  return request({
    url: '/business/statementitem/list',
    method: 'get',
    params: query
  })
}

// 查询结算单明细列表 （不分页）
export function allStatementitem(query) {
  return request({
    url: '/business/statementitem/list',
    method: 'get',
    params: query,
    headers: {'cmd': 'all'}
  })
}

// 查询结算单明细详细
export function getStatementitem(id) {
  return request({
    url: '/business/statementitem/' + id,
    method: 'get'
  })
}

// 新增结算单明细
export function addStatementitem(data) {
  return request({
    url: '/business/statementitem',
    method: 'post',
    data: data
  })
}

// 修改结算单明细
export function updateStatementitem(data) {
  return request({
    url: '/business/statementitem',
    method: 'put',
    data: data
  })
}

// 删除结算单明细
export function delStatementitem(id) {
  return request({
    url: '/business/statementitem/' + id,
    method: 'delete'
  })
}

// 保存结算单明细
export function saveStatementitem(data, id) {
  return request({
    url: '/business/statementitem/' + id,
    method: 'post',
    data: data,
  })
}

// 支付结算单明细
export function payStatementitem(data, id) {
  return request({
    url: `/business/statementitem/${id}`,
    method: 'patch',
    data: data,
    headers: {'cmd': 'pay'}
  })
}